BTERMINAL
Section: File Formats (5)
Updated: local
Index
Return to Main Contents
NAME
bterminal -
adapting the
B
system to your local terminals
DESCRIPTION
The
B
system uses the termcap library to address the terminal,
and determines the codes sent by your terminal's function keys
from the termcap database.
To this end it uses the environment variables TERM and TERMCAP
to determine the type and capabilities of your terminal.
(See
tset(1)
and
termcap(5)
for the exact use of termcap.)
You can also redefine the binding of editing operations
in a
key definitions file.
There are a number of places where this file can be found,
so that there can be different key bindings per terminal
and per user.
It is even possible to define an environment variable giving
this place.
DEFAULT KEY BINDINGS
The following table gives the names of the editing operations,
and the default bindings.
Name Default bindings Termcap bindings
accept ^I (1)
return ^M
widen "\ew" k1 (2)
first "\ef" k2
last "\el" k3
extend "\ee" k4
upline "\eu" k5
previous "\ep" k6
next "\en" k7
downline "\ed" k8
up "\eU" ku
down "\eD" kd
left "\e," kl
right "\e." kr
goto ^G
undo ^H
redo ^U
delete ^D
copy ^C
record ^R
play ^P
look ^L
help "\e?"
exit ^X
ignore (3)
term_init (4) ks
term_done (4) ke
Notes:
- (1)
-
^X means the Control-X character, \e means escape;
see below for an exact description of the format of key definitions.
- (2)
-
The termcap entries
k1 ... k8
describe the codes sent by the function keys,
and
ku ... kd
decribe the codes sent by the arrow keys.
- (3)
-
With the name ignore you can declare input strings illegal; see below.
- (4)
-
The termcap entries ks and ke are sent to the terminal
at startup and upon exiting.
The third column of the table describes additional bindings
for some operations that are derived from termcap,
if the termcap entry for your terminal defines that capability.
If a termcap definition conflicts with some other default,
the definition derived from the termcap holds.
(For instance, on a Televideo the left arrow key sends ^H;
this means that the binding of
undo
to ^H (or [BACKSPACE]) is no longer valid.)
KEY DEFINITIONS FILE
Each line in the key definitions file contains one definition or a comment.
A definition consists of the name of the editing operation
(see the table above), an equals sign
(=),
and one or more
items.
Each
item
can be a string, a number, or a control-character.
The latter is written as `^' followed by a letter.
A number is an octal number if it starts with 0 (it should not
include 8 or 9, then), otherwise it is decimal;
it stands for the corresponding ASCII character.
Strings are delimited by single
(')
or double (") quotes.
Inside strings, the following escape sequences are recognized:
\ddd(one to three octal digits) the ASCII character ddd
\bbackspace, 010
\eescape, 033
\fformfeed, 014
\nlinefeed, 012
\rcarriage return, 015
\ttab, 011
\charany other character (notably \ or ' or ")
Finally, everything from a `#' character to the end of the line is
taken as a comment (except inside a string, of course).
Each definition implies that the concatenation of its items, when received
as input, will provoke the execution of the designated editing
operation.
A definition for the `operation'
ignore
means that this input string will be treated as an illegal operation
(the
B
system will try to ring the bell).
Definitions for the
term_init
and
term_done
operations define strings that will be sent
to
the terminal at initialization time, and on exiting, respectively.
These can be used to set programmable function keys, for instance.
Note that the definitions in the file only
add
to the already existing key bindings (see the defaults above).
When one definition is an initial subsequence of the other,
the last one given in the file holds.
It is probably counter-productive to have the first item of
a definition start with a printable character,
as this would make it impossible to enter that character.
Beware that you cannot use ^] as a key binding when your interrupt
character is not the default [DEL] key; see below.
Examples:
widen = "\ep\r" # HP-2621 function key 1 is escape p return
accept = ^I # tab
undo = ^A "O" ^M # unshifted function key 11 on Televideo
# used because left arrow overwrites ^H
ignore = 0177 # ignore DEL (a common noise character)
The first of the following four files found by the B system is used to
read key bindings from:
$HOME/.Bed_$TERM
B_LIB/.Bed_$TERM
$HOME/.Bed_def
B_LIB/.Bed_def
Here $HOME and $TERM are the values of the environment variables;
see sh(1) and tset(1).
B_LIB stands for a directory appointed by your system administrator
(normally /usr/new/lib/B) where various auxiliary files for the
B
system are kept.
This organization allows different key bindings per user and
per terminal.
HELP FILE
The file B_LIB/Bed_help contains a screenful of help information,
describing the editing operations and the keys to which they are bound.
If you change the key bindings this information is not correct
anymore, and so you can define an environment variable BED_HELP,
that gives the pathname of the file to be printed
when the
help
operation is executed.
INTERRUPT
To interrupt the execution of a
B
command you should normally use the [BREAK] key.
If your interrupt character is the [DEL] key, this will
also work.
However, if you have set your interrupt character
with
stty(1)
to something other than [DEL],
the
B
system will in turn reset it to ^].
This is done to prevent a collision with a key that accesses one of the
B
editing operations, like ^C for copy.
It means that you cannot use ^] as a key binding in a description file
in this case.
INVERSE VIDEO (standout mode)
If your terminal skips a position on the screen when switching
to or from inverse video, you are out of luck.
The
B
editor must be able to display part of a word in inverse video
and the rest normal, without surrounding spaces in between.
You can still use
B
(without the
B
editor) with the command
b -e;
see
b(1).
GOTO OPERATION
The Goto operation can only be used on terminals that can move
the cursor locally, eg. the arrow keys do not send any codes to
the host computer.
If your terminal can be
sensed
for the cursor position, then you can use the operation
to tell it you moved the cursor away.
You should ask your system administrator to add the non standard
capabilities sp and cp to the termcap entry for
your terminal.
The sp capability should define the string sent by the
B
system to the terminal to request the cursor position.
The cp capability must define the format of the cursor position string
as returned by the terminal;
most of the % escapes as defined in termcap(5) for cursor addressing
are recognized.
(For example,
-
cp=\E&a%r%3c%3Y^M:sp=\E`\021
are the entries for a HP2621 terminal.)
FILES
B_LIB /usr/new/lib/B, unless changed by your system administrator
$HOME/.Bed_$TERM key definitions file; first of these four holds
B_LIB/.Bed_$TERM
$HOME/.Bed_def
B_LIB/.Bed_def
$BED_HELP file with one screenful of help info
B_LIB/Bed_help default help file
BUGS
In searching for the key definitions file .Bed_$TERM
the
B
system doesn't recognize aliases for terminal types.
Watch out for variations like e.g. TERM=2621-wl.
Index
- NAME
-
- DESCRIPTION
-
- DEFAULT KEY BINDINGS
-
- KEY DEFINITIONS FILE
-
- HELP FILE
-
- INTERRUPT
-
- INVERSE VIDEO (standout mode)
-
- GOTO OPERATION
-
- FILES
-
- BUGS
-
This document was created by
man2html,
using the manual pages.
Time: 18:37:08 GMT, July 24, 2024